package com.dou.controller;

import com.dou.entity.User;
import com.dou.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class UserController {
    @Autowired
    @SuppressWarnings("all")
    private UserService userService;
    @RequestMapping("hello")
    public String hello(){
        return "hello world";
    }
    @RequestMapping("user")
    @ResponseBody
    public List<User> user(){
        return userService.getAllUser();
    }
}
